package ControllerLayer;
import DomainLayer.*;
import java.util.ArrayList;

public class ToolStockController
{
    private ToolStock stock;
    private static ToolStockController instance;
    
    private ToolStockController()
    {
       stock=ToolStock.getInstance();
    }
    
    public static ToolStockController getInstance()
    {
         if(instance==null)
         {
             instance=new ToolStockController();
            }
            return instance;
        }

    public void addTool(String title, String barCode, double pricePerDay, double deposit, int number)
    {
        stock.addTool(title,barCode,pricePerDay, deposit, number);
    }
    
    public void removeSameTools(String title)
    {
        stock.removeSameTools(stock.searchTools(title));
    }
    
    public String getTool(String barCode)
    {
        return stock.getTool(barCode);
    }
    
    public String searchTool(String barCode, int id)
    {
        return stock.searchTool(barCode,id).toString();
    }
    
    public void deleteTool(String barCode, int id)
    {
        stock.deleteTool(barCode,id);
    }  
}